package com.example.demo.framework;

import java.util.List;

import org.springframework.data.domain.Page;

public class CustomPage {

	private int pageNo;// 当前页码

	private int size;// 每页条数

	private long total;// 总记录数

	private List<Object> Content;

	public CustomPage() {
		super();
	}

	@SuppressWarnings("unchecked")
	public CustomPage(Page<?> page) {
		super();
		this.pageNo = page.getNumber() + 1;
		this.size = page.getSize();
		this.Content = (List<Object>) page.getContent();
	}

	public static int getStartOfPage(int pageNo, int pageSize) {
		return pageNo * pageSize;
	}

	public long getTotal() {
		return total;
	}

	public void setTotal(long total) {
		this.total = total;
	}

	public int getPageNo() {
		return pageNo;
	}

	public void setPageNo(int pageNo) {
		this.pageNo = pageNo;
	}

	public int getSize() {
		return size;
	}

	public void setSize(int size) {
		this.size = size;
	}

	public List<Object> getContent() {
		return Content;
	}

	public void setContent(List<Object> content) {
		Content = content;
	}

}
